package com.bootdo.system.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bootdo.common.utils.Query;
import com.bootdo.system.dao.BizCustomerDao;
import com.bootdo.system.domain.BizCustomerDO;
import com.bootdo.system.domain.BizCustomerIncomeVO;
import com.bootdo.system.service.BizCustomerService;
import com.bootdo.system.vo.ExcelPropertyIndexModel;



@Service
public class BizCustomerServiceImpl implements BizCustomerService {
	@Autowired
	private BizCustomerDao bizCustomerDao;
	
	@Override
	public BizCustomerDO get(String tid){
		return bizCustomerDao.get(tid);
	}
	
	@Override
	public List<BizCustomerDO> list(Map<String, Object> map){
	    map.put("sort", "create_date");
	    map.put("order", "desc");
		return bizCustomerDao.newlist(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return bizCustomerDao.count(map);
	}
	
	@Override
	public int save(BizCustomerDO bizCustomer){
		return bizCustomerDao.save(bizCustomer);
	}
	
	@Override
	public int update(BizCustomerDO bizCustomer){
		return bizCustomerDao.update(bizCustomer);
	}
	
	@Override
	public int remove(String tid){
		return bizCustomerDao.remove(tid);
	}
	
	@Override
	public int batchRemove(String[] tids){
		return bizCustomerDao.batchRemove(tids);
	}

    @Override
    public void updateCustomerActiveStatusByPeriod() {
        bizCustomerDao.updateCustomerActiveStatusByPeriod();
        
    }

    @Override
    public List<ExcelPropertyIndexModel> queryData2Export(Map<String, Object> map) {
        map.put("sort", "bc.create_date");
        map.put("order", "desc");
        return bizCustomerDao.queryData2Export(map);
    }

    @Override
    public List<BizCustomerIncomeVO> incomeStatics(Map<String, Object> query) {
        
        return bizCustomerDao.incomeStatics(query);
    }
	
}
